package main

import (
	"fmt"
	"io"
	"net/http"
	"os"
)

func main() {
	http.HandleFunc("/file", func(w http.ResponseWriter, r *http.Request) {
		r.ParseMultipartForm(1024 * 1024)
		if filehanders, ok := r.MultipartForm.File["file"]; ok {
			for _, filehander := range filehanders {
				file, _ := filehander.Open()
				io.Copy(os.Stdout, file)
			}
		}
	})

	http.HandleFunc("/date", func(w http.ResponseWriter, r *http.Request) {
		r.ParseForm()
		fmt.Println(r.FormValue("x"))
		// fmt.Println(r.Form)
		// fmt.Println(r.PostForm)
	})

	http.ListenAndServe("127.0.0.1:9999", nil)
}
